<style>
.setimg{
	margin:-2px 5px 0 0 
}
</style>
<div class="row-fluid">
	<a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
	    <div class="btn-toolbar">
		    <form>
		    	<label style="display: inline;">用户名称：</label><input class="input input-medium" type="text" name="cust_realname" value="<?=I('get.cust_realname')?>" />
		    	<label style="display: inline;margin-left:10px">手机号码：</label><input class="input input-medium" type="text" name="cust_mobile" value="<?=I('get.cust_mobile')?>" />
		    	<label style="display: inline;margin-left:10px">审核状态：</label>
				<select name="check" style="width: 150px">
					<option value="all">全部</option>
					<option value="0">未审核</option>
					<option value="1">审核通过</option>
					<option value="2">审核不通过</option>
				</select>
				<input type="hidden" value="<?=I('get.res')?>" name="res" />
		    	<button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
		    </form>
		</div>
		<hr>
		<table class="table">
		      <thead>
		        <tr>
		          <th style="text-align:center;width:100px">序号id</th>
		          <th style="text-align:center;width:100px">提现金额</th>
		          <th style="text-align:center;width:170px">用户姓名</th>
		          <th style="text-align:center;">提现参数</th>
		          <th style="text-align:center;width:180px">手机号码</th>
		          <th style="text-align:center;width:140px">申请时间</th>
		          <th style="text-align:center;width:140px">审核状态</th>
		      	  <th style="text-align:center;width:130px">操作</th>
		        </tr>
		      </thead>
		      <tbody>
			  <if condition="$getData">
				  <foreach name="getData" item="vo">
					<tr>
					  <td style="text-align:center;vertical-align:middle;">{{$vo.cust_cashid}}</td>
					  <td style="text-align:center;vertical-align:middle;">{{$vo.cash_money}}</td>
					  <td style="text-align:center;vertical-align:middle;">{{$vo.cust_realname}}</td>
					  <td style="text-align:center;vertical-align:middle;">
						  <center>
							  <table style="text-align:center">
								  <tr>
									  <td>账户姓名：{{$vo.bank_uname}}</td>
									  <td>账户类型：{{$vo.bank}} {{$vo.bank_name}}</td>
								  </tr>
								  <tr>
									  <td colspan=2>提现帐号：{{$vo.bank_card}}</td>
								  </tr>
							  </table>
						  </center>
					  </td>
					  <td style="text-align:center;vertical-align:middle;">{{$vo.cust_mobile}}</td>
					  <td style="text-align:center;vertical-align:middle;">{{$vo.add_at|date='Y-m-d H:i:s',###}}</td>
					  <td style="text-align:center;vertical-align:middle;">
						  <if condition="$vo['is_check'] eq 0">
							  <span class="label label-default">未审核</span>
						  <elseif condition="$vo['is_check'] eq 1"/>
							  <span class="label label-success">审核通过</span>
						  <else/>
							  <span class="label label-warning">审核不通过</span>
						  </if>
					  </td>
					  <td style="text-align:center;vertical-align:middle;">
						  <a class="ifrm btn btn-warning" href="javascript:void(0)" data-url="/index/userMsg" style="padding: 0px 4px;" data-width="1400" data-height="800" data-title="收入明细" data-params="cust_id/{{$vo['cust_id']}}" title="收入明细"><i class="icon-eye-open"></i></a>
						  <if condition="$vo['is_check'] eq 0">
						  <a class="btn btn-warning icheck" style="padding: 0px 4px" href="#myModal" data-toggle="modal" itv="{{$vo.cust_cashid}}" title="审核"><i class="icon-hand-up"></i></a>
						  </if>
					  </td>
					</tr>
				  </foreach>
			  <else/>
				<tr><td style="text-align:center" colspan=8>暂无数据</td></tr>
			  </if>
		      </tbody>
		   </table>
		   <span style="float:right;margin-top:-44px"><?=$page?></span>
	</div>
</div>
<div class="modal small hide fade" itav="0" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h3 id="myModalLabel">处理结果</h3>
	</div>
	<div class="modal-body">
		<p class="error-text"><center>
		<select name="status" id="ostatus" style="width:180px">
			<option value='1'>审核通过</option>
			<option value='-1'>审核不通过</option>
		</select>
	</center></p>
		<p id="ly" style="display: none;margin: 0 auto">审核理由：<textarea type="text" name="reason" id="reason" style="width: 330px;height: 80px;margin: 0 auto;"></textarea></p>
		<input type="hidden" value="0" class="setCashId" />
	</div>
	<div class="modal-footer">
		<button class="btn" id="setResult" data-dismiss="modal" aria-hidden="true">确定</button>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$('.icheck').click(function(){
			$('.setCashId').val($(this).attr('itv'));
		});
		$('#ostatus').change(function(){
			if($(this).val() == '-1'){
				$('#ly').css('display','block');
			}else{
				$('#ly').css('display','none');
			}
		});
		$('#setResult').click(function(){
			if($('.setCashId').val()>0){
				art.dialog({
					title: '',
					lock: true,
					background: '#333',
					opacity: 0.87,
					drag: false,
					resize: false,
					content: '<img src="/statics/arts/skins/icons/loading.gif" /> 处理中，请稍候..'
				});
				$.post('/cash/setCheck',{'check':$('#ostatus :selected').val(),'cashid':$('.setCashId').val(),'reason':$('#reason').val()},function(data){
					var list = art.dialog.list;
					for (var i in list) {
						list[i].close();
					};
					showmsg(data.msg,data.code);
					setTimeout(function(){location.reload();},1000);
				},'json');
			}
		});
	});
</script>